+ Operator

Used to sum two numbers or concatenate two String values.

Notes


Syntax

The + operator has two syntaxes:

result=expression1 + expression2

Part

Type

Description

result

Number

The sum of expression1 and expression2.

expression1

Number

Any numeric expression.

expression2

Number

Any numeric expression.


result=expression1 + expression2

Part

Type

Description

result

String

The concatenation of expression1 and expression2.

expression1

String

Any string expression.

expression2

String

Any string expression.



You can use Operator_Add to define the + operator for custom classes.


Examples

This example adds several numbers together:

Dim x as Integer
x=1+2+3

This example concatenates two strings and stores the result in a variable:

Dim name as String
name="REAL"+"basic" //name = REALbasic

See Also

Operator_Add, Str, Val functions.